//
//  NSObject+ADSafe.h
//  ADKit
//
//  Created by duzexu on 2017/12/8.
//

#import <Foundation/Foundation.h>

@interface NSObject (ADSafe)

- (void)ad_setValue:(id)value forKey:(NSString *)key;
- (void)ad_setValue:(id)value forKeyPath:(NSString *)keyPath;

@end

@interface NSMutableArray (ADSafe)

- (void)ad_addObject:(id)anObject;
- (void)ad_insertObject:(id)anObject atIndex:(NSUInteger)index;
- (void)ad_replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
- (void)ad_removeObjectAtIndex:(NSUInteger)index;
- (void)ad_removeObjectsAtIndexes:(NSIndexSet *)indexes;
- (void)ad_removeObjectsInRange:(NSRange)range;

@end

@interface NSMutableDictionary (ADSafe)

- (void)ad_setObject:(id)anObject forKey:(id<NSCopying>)aKey;
- (void)ad_removeObjectForKey:(id)aKey;

@end

@interface NSCache (ADSafe)

- (void)ad_setObject:(id)obj forKey:(id)key;

@end
